export default {
  methods: {
    dragControllerDiv() {
      if (!this.$refs.left) return;
      const left = this.$refs.left.$el;
      const resize = this.$refs.resize;
      left.style.width = '9rem';
      resize.onmousedown = (e) => {
        const startX = e.clientX;
        resize.left = resize.offsetLeft;
        document.onmousemove = (evt) => {
          const endX = evt.clientX;
          const moveLen = resize.left + (endX - startX);
          resize.style.left = moveLen;
          left.style.width = `${moveLen}px`;
        };
        document.onmouseup = () => {
          document.onmousemove = null;
          document.onmouseup = null;
        };
      };
    },
  },
};
